package so.sao.code.service.infrastructure.jpa.convert;

import javax.persistence.AttributeConverter;
import javax.persistence.Converter;

import so.sao.code.service.domain.FileType;

@Converter(autoApply = true)
public class FileTypeConvert implements AttributeConverter<FileType, Integer> {

	@Override
	public Integer convertToDatabaseColumn(FileType attribute) {
		return attribute.getValue();
	}

	@Override
	public FileType convertToEntityAttribute(Integer dbData) {
		return FileType.get(dbData);
	}

}
